package rebellion.micro.builder;

import rebellion.Person;
import rebellion.util.RebellionEnvironment;
import rebellion.util.RebellionScenarioBuilder;
import repast.simphony.engine.environment.RunEnvironment;
import repast.simphony.parameter.Parameters;

/**
 * Scenario builder for Person class micro level test scenarios.
 * 
 * @author İbrahim Çakırlar
 * 
 */
public class PersonScenarioBuilder extends RebellionScenarioBuilder {

	/*
	 * (non-Javadoc)
	 * 
	 * @see ratkit.repast.RepastScenarioBuilder#createAgents()
	 */
	@SuppressWarnings("unchecked")
	@Override
	protected void createAgents() {
		// get parameter values...
		Parameters p = RunEnvironment.getInstance().getParameters();
		int visNeighbors = (Integer) p.getValue("visNeighbors");
		double govLegitimacy = (Double) p.getValue("govLegitimacy");
		int maxJailTerm = (Integer) p.getValue("maxJailTerm");
		// create a new Person agent for test...
		Person personAgent = RebellionEnvironment.getInstance().createPerson(
				"person1", getGrid(), visNeighbors, maxJailTerm, govLegitimacy);
		getContext().add(personAgent);
	}

}
